{include file="public/header"}
<body>
	<div class="x-nav" style="margin-top: 10px;">
		<span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">文章管理</a>
        <a>
          <cite>文章列表</cite></a>
      </span>
		<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
			<i class="layui-icon" style="line-height:30px">ဂ</i></a>
	</div>
	<div class="x-body">
		<!--<xblock>
			<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
			<button class="layui-btn" onclick="x_admin_show('添加文章','{:url("news/addNews")}','100%' ,'100%')"><i class="layui-icon"></i>添加文章</button>
			<span class="x-right" style="line-height:40px">共有数据：{$total}条</span>
		</xblock>-->
		<table class="layui-table">
			<thead>
				<tr>
					<th style="text-align:center;">ID</th>
					<th>标题</th>
					<th style="text-align:center;">文章分类</th>
					<!--<th style="text-align:center;">关键词</th>-->
					<!-- <th style="text-align:center;">描述</th> -->
					<th style="text-align:center;">浏览次数</th>
					<th style="text-align:center;">发表时间</th>
					<!--<th style="text-align:center;">缩略图</th>-->
					<th style="text-align:center;">操作</th>
				</tr>
			</thead>
			<tbody>
				{volist name="list" id="vo"}
				<tr>
					<td style="text-align:center;">{$vo.id}</td>
					<td>{$vo.title}</td>
					<td style="text-align:center;">{$vo.news_class}</td>
					<!--<td style="text-align:center;">{$vo.keywords}</td>-->
					<!-- <td style="text-align:center;">{$vo.desc}</td> -->
					<td style="text-align:center;">{$vo.view_times}</td>
					<td style="text-align:center;">{$vo.create_time}</td>
					<!--<td class="td-status" style="text-align:center;">
						{$vo.zoom_img}
					</td>-->
					<td class="td-manage" style="text-align:center;">
						<a title="预览"  href='/article/{$vo.id}.html' target="_blank">
							预览
						</a>
						<a title="编辑" onclick="x_admin_show('编辑','{:url("news/updateArticle")}'+'?id='+ {$vo.id},'100%' ,'100%')" href="javascript:;" style="margin:0 15px;">
							编辑
						</a>
						<a title="删除" onclick="article_del(this,{$vo.id})" href="javascript:;">
							删除
						</a>
					</td>
				</tr>
				{/volist}
			</tbody>
		</table>
		<div class="page">
			<div>
				{$page}
			</div>
		</div>

	</div>
	{include file="public/base_js"}
	<script>
		/*文章-删除*/
		function article_del(obj, id) {
			console.log(id);
			layer.confirm('此删除将彻底删除，是否继续？', function(index) {
				$.ajax({
					type: 'post',
					url:"{:url('news/clear_news')}",
					data: {
						id: id
					},
					success (e) {
						if (e.success) {
							layer.msg('删除成功!', {
								icon: 1,
								time: 1000
							},function () {
								window.location.reload(true);
							});	
						}
					}
				})
				
			});
		}
	</script>

</body>

</html>